﻿Atlas_Wnet_MenuFrame:RegisterEvent("QUEST_WATCH_UPDATE");
Atlas_Wnet_MenuFrame:RegisterEvent("QUEST_DETAIL");
Atlas_Wnet_MenuFrame:RegisterEvent("QUEST_GREETING");

GameTooltip:			SetScript("OnShow",Atlas_Wnet_Target_Object)
Atlas_Wnet_MainFrame:		SetScript("OnUpdate",Atlas_Wnet_Talents)
Atlas_Wnet_SendRepBtn:		SetScript("OnUpdate",Enable_SendBtn)
Atlas_Wnet_QuestBtn:		SetScript("OnClick",Add_Quest_To_ReportList)
Atlas_Wnet_QuestBtn:		SetScript("OnUpdate",Update_QuestBtn)
Atlas_Wnet_SendRepBtn:		SetScript("OnEnter",Btn_OnEnter)
Atlas_Wnet_SendRepBtn:		SetScript("OnLeave",HideTooltip)
Atlas_Wnet_SendRepBtn:		SetScript("OnClick",SendRep)
Atlas_Wnet_MenuFrame:		SetScript("OnDragStart",OnDragStart)
Atlas_Wnet_MenuFrame:		SetScript("OnDragStop",OnDragStop)
Atlas_Wnet_WatchRepBtn:		SetScript("OnClick",WatchRepBtn_OnClick)
Atlas_Wnet_ReportFrame:		SetScript("OnDragStart",OnDragStart)
Atlas_Wnet_ReportFrame:		SetScript("OnDragStop",OnDragStop)
MailFrame:			SetScript("OnShow",MailFrame_OnShow)
Atlas_Wnet_ClrRepBtn:		SetScript("OnClick",ClearBagArray)
Atlas_Wnet_NextRepBtn:		SetScript("OnClick",Go_Next_Rep)
Atlas_Wnet_CloseRepBtn:		SetScript("OnClick",WatchRepBtn_OnClick)
Atlas_Wnet_AddNewRepBtn:	SetScript("OnClick",Add_New_Rep)
Atlas_Wnet_AddNewRepBtn:	SetScript("OnUpdate",Update_AddBtn)
Atlas_Wnet_AskBtn:		SetScript("OnClick",Ask_Btn_OnClick)
Atlas_Wnet_NextRepBtn:		SetScript("OnUpdate",Update_NextRepBtn)
Atlas_Wnet_Help[1]:		SetScript("OnClick",Help1Click)
Atlas_Wnet_Help[2]:		SetScript("OnClick",Help2Click)
Atlas_Wnet_Help[3]:		SetScript("OnClick",Help3Click)
Atlas_Wnet_Help[4]:		SetScript("OnClick",Help4Click)

Atlas_Wnet_MenuFrame:SetScript("OnEvent",function(self,...)
local event = ...
	if (event=="QUEST_GREETING" or event=="QUEST_DETAIL" or event=="QUEST_WATCH_UPDATE") then
		quest_update_text = ""
		Atlas_Wnet_Quest()
	end
end)

for i=1,10 do
	Atlas_Wnet_label_[i]:SetScript("OnMouseDown",function(self,...)
	local button = ...
		Labels_OnClick(i,button)
	end)	
end
